<template>
	<view class="commentlist-input">
		<view class="wrap">
			<view class="content">
				<textarea placeholder="请输入留言内容" name="" id="cont" cols="30" rows="10" v-model='comment'></textarea>
				<view class="btn" @click='sendComment'>发表评论</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				comment: '',
			}
		},
		methods: {
			sendComment() {
				//  把数据传递给父组件
				this.$emit('sendtoparent', {
					// username: this.username,
					comment: this.comment,
					createTime: new Date(),
				})
				this.comment = ''
			}
		}
	}
</script>

<style lang="less" scoped>
	.commentlist-input{
		.wrap{
			.content{
				display: flex;
				align-items: center;
				textarea{
					padding: 20rpx 0rpx 0 20rpx;
					height: 200rpx;
					font-size: 27rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #999999;
				}
				view{
					width: 125rpx;
					text-align: center;
					height: 44rpx;
					background: #E2E2E2;
					font-size: 27rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #999999;
					white-space:nowrap;
					line-height: 44rpx;
				}
			}
		}
	}
</style>
